<?php
namespace backend\models;

use yii\base\Model;
use common\models\CounterDataModel;


/**
 * This is the model class for table "{{%counter}}".
 *
 * @property int $id
 * @property int $total_save
 * @property int $total_user
 */
class CounterFormModel extends Model
{
    public $id;
    public $total_save;
    public $total_user;


    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%counter}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'total_save', 'total_user'], 'integer'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'total_save' => '累计返现：(元)',
            'total_user' => '成交用户：(位)',
        ];
    }

//    public function save(){
//
//        $user = AdminUserLogic::instance()->getById(\Yii::$app->user->getId());
//        if($user->validatePassword($this->password)){
//            $user->setPassword($this->newpassword);
//            return $user->save();
//        }
//        $this->addError('password', '密码错误');
//    }
}